<?php
header('Content-type:text/html; charset=utf-8');
include ('conn/conn.php');
$type = $_POST["type"];
$title = $_POST["title"];
$content = $_POST["content"];
//$date = date("Y-m-d");

if (($title=="" || $title == null) || ($content=="" || $content == null)){
	echo "<script type=\"text/javascript\">alert('文章标题和内容不能为空,请重新填写！');history.back();</script>";
}else {
	$sql = mysql_query("insert into tb_content(title,content) values($title','$content')");
	if ($sql){
		echo "<script type=\"text/javascript\">alert('恭喜你，数据上传成功');window.location.href='tinymce_test.php';</script>";
	}else {
		echo "<script type=\"text/javascript\">alert('数据上传失败');window.location.href='tinymce_test.php';</script>";
	}
}